package cn.cytong.util.ext

import io.netty.buffer.ByteBuf

/** 针对netty的ByteBuf的扩展方法
 * Created by orangeJ on 2017/5/29.
 */

fun ByteBuf.readAllBytes(): ByteArray {
    val bytes = ByteArray(readableBytes())
    readBytes(bytes)
    return bytes
}